package com.javacode2018.tx1.demo1;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;

@Component
public class UserService1 extends UserService {
    @Autowired
    protected UserDao userDao;

    public void insert() throws Exception {
        this.userDao.insert("tom11");
        this.insert1();
    }

    @Override
    public void insert1() throws IOException {
        this.userDao.insert("tom22");
        throw new IOException();
    }

}
